package ru.neoflex.chugunov;

import java.util.Date;

import ru.neoflex.chugunov.algorithm.SM2;
import ru.neoflex.chugunov.database.WordJDBCDAO;

public class RateWordsHandler {
	WordJDBCDAO db = new WordJDBCDAO();
	
	public void setRate(Word word, int quality) {
        word.incrementCount();
        SM2.scoreCardAndCalculateInterval(word, quality);
        word.setLastTime(new Date().getTime());
        db.updateWord(word);
	}
}
